1 /*
2 * Copyright (C) 2010 The Guava Authors
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 package com.google.common.collect;
18
19 import com.google.common.annotations.GwtCompatible;
20
21 import java.util.Comparator;
22 import java.util.SortedSet;
23
24 import javax.annotation.Nullable;
25
26 /**
27 * A sorted set multimap which forwards all its method calls to another sorted
28 * set multimap. Subclasses should override one or more methods to modify the
29 * behavior of the backing multimap as desired per the <a
30 * href="http://en.wikipedia.org/wiki/Decorator_pattern">decorator pattern</a>.
31 *
32 * @author Kurt Alfred Kluever
33 * @since 3.0
34 */
35 @GwtCompatible
36 public abstract class ForwardingSortedSetMultimap<K, V>
37 extends ForwardingSetMultimap<K, V> implements SortedSetMultimap<K, V> {
38
39 /** Constructor for use by subclasses. */
40 protected ForwardingSortedSetMultimap() {}
41
42 @Override protected abstract SortedSetMultimap<K, V> delegate();
43
44 @Override public SortedSet<V> get(@Nullable K key) {
45 return delegate().get(key);
46 }
47
48 @Override public SortedSet<V> removeAll(@Nullable Object key) {
49 return delegate().removeAll(key);
50 }
51
52 @Override public SortedSet<V> replaceValues(
53 K key, Iterable<? extends V> values) {
54 return delegate().replaceValues(key, values);
55 }
56
57 @Override public Comparator<? super V> valueComparator() {
58 return delegate().valueComparator();
59 }
60 }